import request from '@/utils/request'

// 查询汽车信息列表
export function listCars(query) {
  return request({
    url: '/paint/cars/list',
    method: 'get',
    params: query
  })
}

//汽车品牌下拉框
export function brand(query) {
  return request({
    url: '/paint/cars/list/brand',
    method: 'get',
    params: query
  })
}
//车型
export function carShape(query) {
  return request({
    url: '/paint/cars/list/car',
    method: 'get',
    params: query
  })
}
//配色方案一
export function blendentShape(query) {
  return request({
    url: '/paint/cars/list/all',
    method: 'get',
    params: query
  })
}

//配色方案二
export function blendentShape2(query) {
  return request({
    url: '/paint/cars/list/all2',
    method: 'get',
    params: query
  })
}


//颜色下拉框
export function colorName(query) {
  return request({
    url: '/paint/cars/list/color',
    method: 'get',
    params: query
  })
}
//油漆品牌下拉框
export function paintShape(query) {
  return request({
    url: '/paint/cars/list/paint',
    method: 'get',
    params: query
  })
}

// 查询汽车信息详细
export function getCars(id) {
  return request({
    url: '/paint/cars/' + id,
    method: 'get'
  })
}

// 新增汽车信息
export function addCars(data) {
  return request({
    // url: '/paint/cars',
    url: '/paint/cars/insertCarAndColorScheme',
    method: 'post',
    data: data
  })
}

// 修改汽车信息
export function updateCars(data) {
  return request({
    url: '/paint/cars',
    method: 'put',
    data: data
  })
}

// 删除汽车信息
export function delCars(id) {
  return request({
    url: '/paint/cars/new/' + id,
    method: 'delete'
  })
}


// 收藏
export function stick(id,sort) {
  return request({
    // url: '/paint/cars/updateSort',
    url: `/paint/cars/updateSort?id=${encodeURIComponent(id)}&sort=${encodeURIComponent(sort)}`,
    method: 'post',
    // data: data
  })
}

